export default class PlayerAgent{
  constructor(game, unit) {
    this.game = game
    this.unit = unit
    console.log(this.unit.dir)
    this.game.emitter.on('action',(data)=>{
      const {type, position} = data
      if(type === 'move'){
        this.unit.moveTo(position[0], position[1])
      }else{
        // attack
        this.unit.attackTo(position[0], position[1])
      }
    })
  }
}
